package com.shop.goods;

import com.alibaba.fastjson.JSONObject;
import com.shop.base.BaseResponse;
import com.shop.goods.inputDTO.GoodsQueryDTO;
import com.shop.goods.outputtDTO.GoodsMessageDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "商品服务")
public interface GoodsService {
    /**
     *
     * @param page
     * @param limit
     * @param goodsQueryDTO 插叙条件
     * @return
     */
    @GetMapping("getAllGoods")
    @ApiOperation("获取商品列表")
    BaseResponse<List<GoodsMessageDTO>>getAllGoods(@RequestParam("page")Integer page, @RequestParam("limit")Integer limit
    , @RequestBody GoodsQueryDTO goodsQueryDTO);

    /**
     * 修改商品
     * @param goodsMessageDTO
     * @return
     */
    @PostMapping("updateGoods")
    @ApiOperation("修改商品信息")
    BaseResponse<JSONObject>updateGoods(@RequestBody GoodsMessageDTO goodsMessageDTO);

    /**
     * 删除商品
     * @param id
     * @return
     */
    @DeleteMapping("deleteGoods")
    @ApiOperation("删除商品")
    BaseResponse<JSONObject>deleteGoods(@RequestParam("id") String id);



}
